<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
$(document).ready(function(){
	$("#loginForm").submit(function(){
		if($("#id").val()==""){	// id 일 경우 #아이디, // name 일 경우 input[name=아이디]
			alert("아이디를 입력해주세요!");
			return false;
		}else if($("#password").val()==""){
			alert("비밀번호를 입력해주세요!");
			return false;
		}
	});
});

</script>
<c:choose>
	<c:when test="${sessionScope.mvo==null }">
	<!-- 세션이 없으면 보여준다.  -->
		<form id="loginForm" name="loginForm" action="loginMember.inven" method="post" onsubmit="return checkForm()">
			&nbsp;&nbsp;
			<input class="input_form" type="text" name="id" id="id" placeholder="id"><br>
			&nbsp;&nbsp;
			<input class="input_form" type="password" name="password" id="password" placeholder="password"><br>
			<input class="login_button" type="submit" value="LOGIN"><br>
			<a href="registerMember.inven" class="menu_font_red">Sign In</a><br>
			<a href="findIdAndPassword.inven" class="menu_font_red">Lost ID/Password?</a><br>
		</form>
	</c:when>
	<c:otherwise>
	
		<!-- 세션이 있으면 보여준다. -->
		
		<center>${sessionScope.mvo.name } 님 환영합니다!</center>
		<br>
		<c:choose>
			<c:when test="${sessionScope.mvo.saveImage!=null }">
				<center>
					<img height="120" src="userpics/${sessionScope.mvo.saveImage }" style="max-width: 190px;max-height: 120px; height:auto; resize:both;">
				</center>
				<br>
			</c:when>
			<c:otherwise>
				<center>
					<img src="img/noimage.png" alt="noImage" style="max-width: 190px; max-height: 120px;height:auto;resize:both;">
				</center>
				<br>
			</c:otherwise>
		</c:choose>
		
		<a href="logoutMember.inven" class="menu_font_red">Logout</a><br>
			<%-- <c:if test="${sessionScope.mvo.name=='secessionMember' }">
				<script type="text/javascript">
					location.href="logoutMember.inven";
				</script>
			</c:if> --%>

		<!-- 로그인시만 보여줌 -->
		<a href="showMyInfo.inven?id=${sessionScope.mvo.id }" class="menu_font_red">Update info</a>
	</c:otherwise>
</c:choose>

